
package com.pfsoft.controller;


import com.pfsoft.util.ChannelUtil;
import io.netty.channel.Channel;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {
    @GetMapping("/clientone")
    public void callClientOne()
    {
        Channel clientOne = ChannelUtil.getClientChannel("client---clientOne");
        clientOne.writeAndFlush("我是服务器，我给clientOne发消息在");
    }

    @GetMapping("/clienttwo")
    public void callClientTwo()
    {
        Channel clientTwo = ChannelUtil.getClientChannel("client---clientTwo");
        clientTwo.writeAndFlush("我是服务器，我给clientTwo发消息在");
    }
    @GetMapping("/index")
    public String index()
    {
        return "hello netty";
    }
}
